<template>
<div>
<div class="block" style="display: flex;">
  <el-pagination
  ref="pagination"
    layout="prev, pager, next"
    :total="arr2/(hangshu/10)"
    @current-change="xk"
    >
  
  </el-pagination>
  <slot></slot>
</div>
 </div>
</template>
<script>
export default {
props:["arr","arr2",'hangshu'],
data(){
return{
}
},
watch:{
  arr2: {
        handler() {
          // 元素的引用（refs）获取名为“pagination”的组件或元素的当前页码。
          this.xk(this.$refs.pagination.currentPage);
        },
        // immediate: true, //一进入页面就执行handler里的代码
        deep: true,
      },
},
created(){
},
computed:{
},
methods:{
    xk(val){
      // const currentPage = val;
      // const pageSize = this.$refs.pagination.pageSize;
      // const total = this.$refs.pagination.total;
      // // const totalPages = Math.ceil(total / pageSize);
      // const currentPageText = `${(currentPage - 1) * pageSize + 1} - ${Math.min(currentPage * pageSize, total)} of ${total}`;
      // console.log(currentPageText);
      //   console.log(val);
      this.$emit('shu',val)
    }
},
}
</script>
<style lang='less' scoped>
</style>
